'''
工具栏
'''

import sys,math
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *

class ToolBar(QMainWindow):
    def __init__(self):
        super().__init__()
        self.initUI()
    def initUI(self):
        self.setWindowTitle("工具栏")
        self.resize(300, 200)

        tb1 = self.addToolBar("Files")

        new = QAction(QIcon('../controls/python.png'), "new", self)
        tb1.addAction(new)
        open_ = QAction("open", self)
        tb1.addAction(open_)
        tb1.setToolButtonStyle(Qt.ToolButtonTextBesideIcon)
    # def process(self, a):
    #     print(self.sender().text())
if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = ToolBar()
    ex.show()
    sys.exit(app.exec_())